package com.lilong.jwt.common.exception;

import com.lilong.jwt.common.util.ValidationResult;
import lombok.Getter;

@Getter
public class HydrauException extends RuntimeException {
    private Integer code;
    private Object detail;

    public HydrauException(ExceptionEnum exceptionEnum) {
        super(exceptionEnum.getMsg());
        this.code = exceptionEnum.getCode();
    }
    public HydrauException(ValidationResult result, String msg){
        super(msg+ ExceptionEnum.OBJECT_PARAM.getMsg());
        this.code= ExceptionEnum.OBJECT_PARAM.getCode();
        this.detail=result;
    }

    public HydrauException(ExceptionEnum exceptionEnum, String msg) {
        super(msg+ exceptionEnum.getMsg());
        this.code = exceptionEnum.getCode();
    }

}
